package com.miniprogram.common.enums;

/**
 * 订单购买类型
 *
 * @author lin
 * @since 2020年1月5日
 */
public enum OrderTypeEnum {

    // 小时房
    HOUR(1, "小时房"),
    // 日房
    DAY(2, "日房");

    private Integer code;

    private String name;

    OrderTypeEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static OrderTypeEnum ValueOfName(String name) {
        for (OrderTypeEnum orderTypeEnum : OrderTypeEnum.values()) {
            if (orderTypeEnum.code.equals(name)) {
                return orderTypeEnum;
            }
        }
        return null;
    }
}
